<script setup>
const props = defineProps(['cbt', 'title', 'color', 'disabled', 'icon', 'loading'])
const emits = defineEmits(['confirm'])
</script>

<template>
  <el-popconfirm
    :title="props.title"
    :confirm-button-text="props.cbt[0]"
    :cancel-button-text="props.cbt[1]"
    @confirm="emits('confirm')"
  >
    <el-button
      slot="reference"
      class="text-btn-el-button"
      type="text"
      round
      size="mini"
      :icon="props.icon"
      :disabled="props.disabled"
      :loading="props.loading"
      :style="{ color: props.color || '#f56c6c' }"
    >
      <slot />
    </el-button>
  </el-popconfirm>
</template>

<style lang="scss">
.text-btn-el-button{
  padding: 0 !important;
}
</style>
